package com.content.scaffold.common.mybatis;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serial;
import java.io.Serializable;
import java.util.Date;

/**
 * @author xiaojl
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class BaseEntity extends Model<BaseEntity> implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;


    public static final String ID = "id";

    public static final String UPDATE_TIME = "updateTime";
    public static final String CREATED_TIME = "createdTime";
    public static final String CREATED_DEPT_ID = "createdDeptId";





    /**
     * id
     */
    @TableId(type = IdType.INPUT)
    private Long id;

    /**
     * 创建时间
     */
    @TableField(fill = FieldFill.INSERT)
    private Date createdTime;

    /**
     * 最后更新时间
     */
    @TableField(fill = FieldFill.UPDATE)
    private Date updatedTime;


    /**
     * 归属公证处
     */
    @TableField(fill = FieldFill.INSERT)
    private String createdDeptId;



    /**
     * 版本号
     */
    @Version
    private long version;
    /**
     * 逻辑删除
     */
    @TableLogic(value = "false", delval = "true")
    private boolean deleted = false;

}
